package com.betterjr.modules.commissionfile;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.betterjr.common.web.ControllerExceptionHandler;
import com.betterjr.common.web.ControllerExceptionHandler.ExceptionHandler;
import com.betterjr.common.web.Servlets;

@Controller
@RequestMapping(value = "/Scf/Commissionfiledownhistory")
public class CommissionFileDownHistoryController {

    private static final Logger logger = LoggerFactory.getLogger(CommissionFileDownHistoryController.class);

    @Reference(interfaceClass = ICommissionFileDownHistoryService.class)
    private ICommissionFileDownHistoryService fileDownHistoryService;

    @RequestMapping(value = "/queryFileDownHistroyList", method = RequestMethod.POST)
    public @ResponseBody String queryFileDownHistroyList(HttpServletRequest request, String flag, int pageNum,
            int pageSize) {
        final Map<String, Object> anMap = Servlets.getParametersStartingWith(request, "");
        return ControllerExceptionHandler.exec(new ExceptionHandler() {
            @Override
            public String handle() {
                return fileDownHistoryService.webQueryFileDownHistroyList(anMap, flag, pageNum, pageSize);
            }
        }, "佣金文件下载历史记录查询失败", logger);

    }

}
